Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

[DAY01] 七天理解SOLID原則-概念篇

[DAY01] 七天理解SOLID原則-概念篇

Check If All 1's Are at Least Length K Places Away

Check If All 1's Are at Least Length K Places Away

第五天:爬蟲【三】

第五天:爬蟲【三】


Comments